package com.xlh.support.quiz.dao;

import com.xlh.dto.quiz.EssayQuestionStaticsDTO;
import com.xlh.dto.quiz.TrueOrFalseQuestionStaticsDTO;
import com.xlh.dto.quiz.UserQuizStatusDTO;
import com.xlh.support.quiz.domain.QuizAnswer;
import com.xlh.support.quiz.domain.example.QuizAnswerExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface QuizAnswerMapper {
    long countByExample(QuizAnswerExample example);

    int deleteByExample(QuizAnswerExample example);

    int deleteByPrimaryKey(Long id);

    int insert(QuizAnswer record);

    int insertSelective(QuizAnswer record);

    List<QuizAnswer> selectByExample(QuizAnswerExample example);

    QuizAnswer selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") QuizAnswer record, @Param("example") QuizAnswerExample example);

    int updateByExample(@Param("record") QuizAnswer record, @Param("example") QuizAnswerExample example);

    int updateByPrimaryKeySelective(QuizAnswer record);

    int updateByPrimaryKey(QuizAnswer record);

    EssayQuestionStaticsDTO essayQuestionStatistic(@Param("chapterId")Long chapterId, @Param("userIds") List<Long> userIds);

    TrueOrFalseQuestionStaticsDTO trueOrFalseQuestionsStatistic(@Param("chapterId")Long chapterId, @Param("userIds")List<Long> userIds);

    List<UserQuizStatusDTO> findQuizStatisticByUserIds( @Param("chapterIds") List<Long> chapterIds, @Param("userIds") List<Long> userIds );
}